package com.yq.testmodule.lottie

import android.widget.Button
import base.BaseActivity
import com.airbnb.lottie.LottieAnimationView
import com.alibaba.android.arouter.facade.annotation.Route
import com.yq.testmodule.R
import config.TEST_Lottie

@Route(path = TEST_Lottie)
class LottieActivity: BaseActivity() {
    override fun initLayout(): Int {
         return R.layout.activity_test_lottie
    }

    override fun initView() {
        val lottieView = findViewById<LottieAnimationView>(R.id.lottie_view)
        lottieView.speed = 1.5f
        findViewById<Button>(R.id.btn_start).setOnClickListener {
            if(!lottieView.isAnimating){
                lottieView.playAnimation()
            }

        }
    }

    override fun initData() {
    }
}